package com.haipumi.actions;

import com.haipumi.beans.JsonModel;
import com.opensymphony.xwork2.ActionSupport;

public class GetRandomNumAction extends ActionSupport {

	private static final long serialVersionUID = -4086031558333008209L;

	private static int RandomNum = 1000;
	private JsonModel jm=new JsonModel();
	
	@Override
	public String execute() throws Exception {
		jm.setCode(getRandomNum());
		return "success";
	}

	public JsonModel getJm() {
		return jm;
	}
	
	public static synchronized int getRandomNum() {
		RandomNum++;
		return RandomNum;
	}

}
